﻿using System;

namespace ResourceEnumerator.Inrastructure
{
    public sealed class ResourceItem
    {
        public string Key { get; }

        public string ElementType { get; }

        public ResourceItem(string key, string elementType)
        {
            if (string.IsNullOrWhiteSpace(key)) throw new ArgumentNullException(nameof(key));
            if (string.IsNullOrWhiteSpace(elementType)) throw new ArgumentNullException(nameof(elementType));

            Key = key;
            ElementType = elementType;
        }

        public string XKey => $"x:Key=\"{Key}\"";

        public override string ToString()
        {
            return $"{Key} ({ElementType})";
        }
    }
}
